<?php

namespace app\common\model;

use think\Db;
use think\Model;

class Goods extends Model
{
    protected $pk='goods_id';
    protected $table='hb_goods';
    //获得数据函数
	public function getAll(){
//		return Db::table('hb_goods')->where('goods_isrecycle',1)->paginate(true);
		return Db::table('hb_goods')
			->alias('g')
			->join('hb_category c','g.cate_id = c.cate_id')
			->where('goods_isrecycle',1)
			->paginate(2);
	}

	//获得回收站的数据
	public function getRecycleData(){
		return Db::table('hb_goods')
			->alias('g')
			->join('hb_category c','g.cate_id = c.cate_id')
			->where('goods_isrecycle',0)
			->paginate(2);
	}






}
